5514a668bfc258e25935f704ff052ece0e102e30,core/mybatis-generator-core/src/main/java/org/mybatis/generator/codegen/mybatis3/javamapper/elements/sqlprovider/ProviderCountByExampleMethodGenerator.java,ProviderCountByExampleMethodGenerator,addClassElements,#TopLevelClass#,42
Before Change
context.getCommentGenerator().addGeneralMethodComment(method,
introspectedTable);
method.addBodyLine("BEGIN();"); //$NON-NLS-1$
method.addBodyLine("SELECT(\"count(*)\");"); //$NON-NLS-1$
method.addBodyLine(String.format("FROM(\"%s\");", //$NON-NLS-1$
escapeStringForJava(introspectedTable.getAliasedFullyQualifiedTableNameAtRuntime())));
method.addBodyLine("applyWhere(example, false);"); //$NON-NLS-1$
After Change
context.getCommentGenerator().addGeneralMethodComment(method,
introspectedTable);
if (useLegacyBuilder) {
method.addBodyLine("BEGIN();"); //$NON-NLS-1$
method.addBodyLine("SELECT(\"count(*)\");"); //$NON-NLS-1$
method.addBodyLine(String.format("FROM(\"%s\");", //$NON-NLS-1$
escapeStringForJava(introspectedTable.getAliasedFullyQualifiedTableNameAtRuntime())));
method.addBodyLine("applyWhere(example, false);"); //$NON-NLS-1$
method.addBodyLine("return SQL();"); //$NON-NLS-1$
} else {
method.addBodyLine("SQL sql = new SQL();"); //$NON-NLS-1$
method.addBodyLine(String.format("sql.SELECT(\"count(*)\").FROM(\"%s\");", //$NON-NLS-1$
escapeStringForJava(introspectedTable.getAliasedFullyQualifiedTableNameAtRuntime())));
method.addBodyLine("applyWhere(sql, example, false);"); //$NON-NLS-1$
method.addBodyLine("return sql.toString();"); //$NON-NLS-1$
}
if (context.getPlugins().providerCountByExampleMethodGenerated(method, topLevelClass,